<?php
$backend = dirname(dirname(__FILE__));
$frontend=dirname($backend).'/protected';

Yii::setPathOfAlias('backend', $backend);

$frontendArray = require_once($frontend . '/config/main.php');
$backendArray = array(
    'name' => '网站后台',
    'basePath' => $frontend,
    'viewPath' => $backend . '/views',
    'controllerPath' => $backend . '/controllers',
    'runtimePath' => $backend . '/runtime',
    'import' => array(
        'application.models.*',
        'application.components.*',
        'backend.models.*',
        'backend.components.*',
    ),
    'components' => array(
        'user' => array(
            //'class' => 'AdminWebUser',
            'allowAutoLogin' => true,
            'stateKeyPrefix' => 'admin', //session名前缀
            'loginUrl' => array('site/login'),
        ),
    ),
);
if (isset($frontendArray['components']['user']))
    unset($frontendArray['components']['user']); //unset loginUrl
return CMap::mergeArray($frontendArray, $backendArray);